package com.ocom.accesservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.github.pagehelper.PageInfo;
import com.ocom.common.entity.access.EntityMjGroupPer;
import com.ocom.common.request.access.GetGroupPerReq;
import com.ocom.common.request.wx.UserAccessPageSetAccessRequest;
import com.ocom.common.vo.AccessListVo;
import com.ocom.common.vo.DelAreaVo;
import com.ocom.common.vo.UserAccessListVo;

import java.util.List;

public interface GroupPerService extends IService<EntityMjGroupPer> {

    ///a)从人员门禁权限表mj_group_per查出count (p_id)
    public Integer CountPid(Long areaId, Long comId);

    /**
     * 移除区域
     * */
    public void RemoveArea(DelAreaVo delAreaVo, Long companyId);


    /**
     * 查找有权限的
     */
    public List<EntityMjGroupPer> getList(Long companyId,Long pId);


    /**
     * 区域权限列表
     */
    public List<UserAccessListVo> getAccessListByArea(Long companyId, Long areaNo);




    /**
     * 权限列表
     */
    public List<AccessListVo> getListByUid(Long companyId, Long pId);

    /**
     * 修改权限
     * @param companyId
     * @param request
     * @return
     */
    public EntityMjGroupPer changeAccess(Long companyId,UserAccessPageSetAccessRequest request);


    List<UserAccessListVo> getUserAccessListByArea(Long companyId,Long areaNo,Long deptId);

    //从mj_group_per表查找com_id=companyId、p_id=userId、group_no>0的记录。
    public List<EntityMjGroupPer> getGroupPerInfo(Long comId, Long userId);


    public boolean removeUser(Long companyId,Long pId);


    void removeWhiteUser(Long companyId,Long pId);


    PageInfo<EntityMjGroupPer> getGroupPerList(Long companyId, GetGroupPerReq req);

}
